home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 23
/
Aminet 23 (1998)(GTI - Schatztruhe)[!][Feb 1998].iso
/
Aminet
/
dev
/
e
/
EasyPLUGINs.lha
/
EasyPLUGINs
/
examples
/
xygadget_demo.e
< prev
Wrap
Text File
|
1997-11-08
|
2KB
|
60 lines
/*
*/
OPT PREPROCESS, OSVERSION=37
MODULE 'tools/easygui', 'easyplugins/xygadget',
'utility', 'utility/tagitem'
DEF xygadget_1:PTR TO xygadget_plugin,
xygadget_2:PTR TO xygadget_plugin,
disabled=TRUE
PROC main() HANDLE
IF (utilitybase:=OpenLibrary('utility.library', 37))=NIL THEN Raise("utlb")
NEW xygadget_1.xygadget([PLA_XYGadget_Text, 'Testing',
PLA_XYGadget_Disabled, disabled,
TAG_DONE])
NEW xygadget_2.xygadget([PLA_XYGadget_Text, 'A second gadget',
PLA_XYGadget_Disabled, disabled,
TAG_DONE])
easyguiA('xygadget_plugin example', [ROWS,
[PLUGIN, {gadget_pressed}, xygadget_1, TRUE],
[PLUGIN, {gadget_pressed}, xygadget_2, TRUE],
[COLS,
[CHECK, {toggle_disabled}, '_Disabled?', disabled, FALSE, -1, "d"],
[SPACEH],
[BUTTON, 0, 'Quit']
]
])
EXCEPT DO
END xygadget_1, xygadget_2
IF utilitybase THEN CloseLibrary(utilitybase)
ENDPROC
PROC toggle_disabled()
IF disabled THEN disabled:=FALSE ELSE disabled:=TRUE
xygadget_1.set(PLA_XYGadget_Disabled, disabled)
xygadget_2.set(PLA_XYGadget_Disabled, disabled)
ENDPROC
PROC gadget_pressed(gh:PTR TO guihandle, xygadget:PTR TO xygadget_plugin)
WriteF('You pressed the gadget with \a\s\a on it.\n\n', xygadget.get(PLA_XYGadget_Text))
ENDPROC